<?php
namespace app\common\request;

class Poster extends Base {
	//获取二维码名称
	public function get_name() {
		return $this->post('name', 'poster');
	}

	//获取要跳转的路径
	public function get_path() {
		$path = $this->post('path', 'pages/index/index');
		$params = $this->post('params', '1:1');
		$params = str_replace(':', '=', $params);
		$params = str_replace(',', '&', $params);
		return $path . '?' . $params;
	}

	public function get_code_data() {
		$name = $this->get_name();
        $path = $this->get_path();
        $update = $this->post('update', false);
        return compact('name', 'path', 'update');
	}
}
